﻿<!DOCTYPE html>
<html lang="es">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Pablo Chacón Luna - Web development - Freelancer</title>
    <link href="~/favicon.ico" rel="shortcut icon" type="image/x-icon" />
</head>
<body id="page-top" class="index">
    <div ng-app="myApp" ng-controller="ctrl">
        <header>
            <button ng-click="toggleLang()">Toggle Language</button>
            <h1>{{ 'HEADLINE' | translate }}</h1>
            <h3>{{ 'SUB_HEADLINE' | translate }}</h3>
            <p>By <a href="http://twitter.com/PascalPrecht">{{ 'AUTHOR_NAME' | translate }}</a> - <a href="http://github.com/PascalPrecht/ng-translate">{{ 'GITHUB_LINK_TEXT' | translate }}</a></p>
        </header>        
    </div>
    <!--<script src="//cdnjs.cloudflare.com/ajax/libs/angular.js/1.0.3/angular.min.js"></script>--> 
    <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.12/angular.min.js"></script>
    <script src="Scripts/angular-translate.js"></script>
    <script>
        // Configuring your module, asking for ngTranslate as dependency
        var app = angular.module('myApp', ['ngTranslate']);

        // Configuring $translateProvider
        app.config(['$translateProvider', function ($translateProvider) {

            // Simply register translation table as object hash
            $translateProvider.translations('en_EN', {
                'HEADLINE': 'Introducing ngTranslate',
                'SUB_HEADLINE': 'Translations for your Angular Apps!',
                'AUTHOR_NAME': 'Pascal Precht',
                'GITHUB_LINK_TEXT': 'View source on GitHub'
            });

            $translateProvider.translations('de_DE', {
                'HEADLINE': 'ngTranslate',
                'SUB_HEADLINE': 'Internationalisierung für deine Angular Apps!',
                'AUTHOR_NAME': 'Pascal Precht',
                'GITHUB_LINK_TEXT': 'Code auf GitHub ansehen'
            });

            $translateProvider.uses('en_EN');
        }]);
        app.controller('ctrl', ['$translate', '$scope', function ($translate, $scope) {
            $scope.toggleLang = function () {
                $translate.uses() === 'en_EN' ? $translate.uses('de_DE') : $translate.uses('en_EN');
            };
        }]);
    </script>  
</body>
</html>